/* don't change the order of these without updating frame save/return double word accesses */
#define FRAME_PC            0
#define FRAME_X1            1
#define FRAME_X2            2
#define FRAME_X3            3
#define FRAME_X4            4
#define FRAME_X5            5
#define FRAME_X6            6
#define FRAME_X7            7
#define FRAME_X8            8
#define FRAME_X9            9
#define FRAME_X10           10
#define FRAME_X11           11
#define FRAME_X12           12
#define FRAME_X13           13
#define FRAME_X14           14
#define FRAME_X15           15
#define FRAME_X16           16
#define FRAME_X17           17
#define FRAME_X18           18
#define FRAME_X19           19
#define FRAME_X20           20
#define FRAME_X21           21
#define FRAME_X22           22
#define FRAME_X23           23
#define FRAME_X24           24
#define FRAME_X25           25
#define FRAME_X26           26
#define FRAME_X27           27
#define FRAME_X28           28
#define FRAME_X29           29
#define FRAME_X30           30
#define FRAME_X31           31

#define FRAME_RA            FRAME_X1
#define FRAME_SP            FRAME_X2
#define FRAME_GP            FRAME_X3
#define FRAME_TP            FRAME_X4
#define FRAME_T0            FRAME_X5
#define FRAME_T1            FRAME_X6
#define FRAME_T2            FRAME_X7
#define FRAME_S0            FRAME_X8
#define FRAME_FP            FRAME_X8
#define FRAME_S1            FRAME_X9
#define FRAME_A0            FRAME_X10
#define FRAME_A1            FRAME_X11
#define FRAME_A2            FRAME_X12
#define FRAME_A3            FRAME_X13
#define FRAME_A4            FRAME_X14
#define FRAME_A5            FRAME_X15
#define FRAME_A6            FRAME_X16
#define FRAME_A7            FRAME_X17
#define FRAME_S2            FRAME_X18
#define FRAME_S3            FRAME_X19
#define FRAME_S4            FRAME_X20
#define FRAME_S5            FRAME_X21
#define FRAME_S6            FRAME_X22
#define FRAME_S7            FRAME_X23
#define FRAME_S8            FRAME_X24
#define FRAME_S9            FRAME_X25
#define FRAME_S10           FRAME_X26
#define FRAME_S11           FRAME_X27
#define FRAME_T3            FRAME_X28
#define FRAME_T4            FRAME_X29
#define FRAME_T5            FRAME_X30
#define FRAME_T6            FRAME_X31

#define FRAME_VECTOR        FRAME_A7
#define FRAME_STATUS        32
#define FRAME_SAVED_A0      33
#define FRAME_CAUSE         34

// XXX might need to rethink some things for status and cause to be in pstate
#define FRAME_N_PSTATE      35

#define FRAME_FAULT_ADDRESS 35
#define FRAME_STACK_TOP     36
#define FRAME_FULL          37
#define FRAME_EXTENDED      38
#define FRAME_SIZE          39

#define FRAME_F0            0
#define FRAME_F1            1
#define FRAME_F2            2
#define FRAME_F3            3
#define FRAME_F4            4
#define FRAME_F5            5
#define FRAME_F6            6
#define FRAME_F7            7
#define FRAME_F8            8
#define FRAME_F9            9
#define FRAME_F10           10
#define FRAME_F11           11
#define FRAME_F12           12
#define FRAME_F13           13
#define FRAME_F14           14
#define FRAME_F15           15
#define FRAME_F16           16
#define FRAME_F17           17
#define FRAME_F18           18
#define FRAME_F19           19
#define FRAME_F20           20
#define FRAME_F21           21
#define FRAME_F22           22
#define FRAME_F23           23
#define FRAME_F24           24
#define FRAME_F25           25
#define FRAME_F26           26
#define FRAME_F27           27
#define FRAME_F28           28
#define FRAME_F29           29
#define FRAME_F30           30
#define FRAME_F31           31
#define FRAME_FCSR          32
#define FRAME_EXTENDED_MAX  33

#define ERR_FRAME_S0    0
#define ERR_FRAME_S1    1
#define ERR_FRAME_S2    2
#define ERR_FRAME_S3    3
#define ERR_FRAME_S4    4
#define ERR_FRAME_S5    5
#define ERR_FRAME_S6    6
#define ERR_FRAME_S7    7
#define ERR_FRAME_S8    8
#define ERR_FRAME_S9    9
#define ERR_FRAME_S10   10
#define ERR_FRAME_S11   11
#define ERR_FRAME_RA    12
#define ERR_FRAME_SP    13
#define ERR_FRAME_SIZE  14

#define ERR_FRAME_FULL  ERR_FRAME_RA
